<?php

class DashboardController extends ProjectController
{
	/**
	 * Declares class-based actions.
	 */
	public function actions()
	{
		return array(

			// page action renders "static" pages stored under 'protected/views/site/pages'
			// They can be accessed via: index.php?r=site/page&view=FileName
			'page'=>array(
				'class'=>'CViewAction',
			),
		);
	}
	public $layout = "//layouts/dashboard";
	public $projects = array();
	public $user = array();
	public $avatar = array();
	public $defaultAction = 'index';
	public function init(){
		$this->projects = Projects::model()->getProject();
		if(!empty($this->projects)){
			$this->projects->id = outStr($this->projects->id);
			$this->projects->user_id = outStr($this->projects->user_id);
			$this->projects = $this->projects->attributes;
		}else{
		
		}
		parent::init();
		Yii::app()->theme="teeple";
	}
	
	
	
	
	
	
	
	public function actionIndex()
	{
		
		
		
		if(Yii::app()->user->isGuest) $this->redirect('/');
		
		$this->user = currentUser(true)->attributes;
		$this->user['id'] = outStr($this->user['id']);
		$this->user['group_id'] = outStr($this->user['group_id']);
		$this->avatar = currentUser()['avatar'];
		
		
		$this->render('index',array(
			
		));
	}
}